import { ACCESS_CONFIG } from './accessConfig';

const BABY = 'Baby';
const FEM = 'Fem';
const ADMIN = 'Admin';
const PRPD = 'PRPD';
const TESTER = 'Tester';
const DROPDOWN = 'Dropdown';
const TEXTINPUT = 'Text Input';
const NUMBERINPUT = 'Number Input';
const DATEPICKER = 'Date picker';
const ATTACHMENT = 'Attachment';
const TEXTAREA = 'TextArea';
const DEFAULTATTACHMENTURL = ACCESS_CONFIG.DEFAULTATTACHMENTURL;
const DEFAULTIMAGEURL = ACCESS_CONFIG.DEFAULTIMAGEURL;
const DEFAULTPLOTIMAGEURL = ACCESS_CONFIG.DEFAULTPLOTIMAGEURL;
const REDIRECTURI = ACCESS_CONFIG.REDIRECTURI;
const LOGINPATH = ACCESS_CONFIG.LOGINPATH;
const REFRESHTOKENRUI = ACCESS_CONFIG.REFRESHTOKENRUI;
const OCPAPIMSUBSCRIPTIONKEY = ACCESS_CONFIG.OCPAPIMSUBSCRIPTIONKEY;
const PINGVALIDATEURL = ACCESS_CONFIG.PINGVALIDATEURL;
const EAGLEEYEURL = ACCESS_CONFIG.EAGLEEYEURL;
const DATEFORMAT = 'YYYY-MM-DD';
const DATEFORMAT_HMS = 'YYYY-MM-DD HH:mm:ss';
const SYSCODE = 'zhurong';
// 上传类型
const ACCEPT_TYPE = {
  XLS: {
    TYPE: ['.xls', '.xlsx'],
    VERIFIED: ['xls', 'xlsx', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']
  },
  PY: {
    TYPE: ['.py'],
    VERIFIED: ['py']
  },
  IMAGE: {
    TYPE: ['image/*'],
    VERIFIED: ['image/bmp', 'image/png', 'image/jpeg', 'image/jpg']
  },
  XML: {
    TYPE: ['.xml'],
    VERIFIED: ['text/xml', '.xml']
  },
  TEXT: {
    TYPE: ['.text'],
    VERIFIED: ['.text']
  },
  ALL: {
    TYPE: ['*'],
    VERIFIED: []
  },
  SPA: {
    TYPE: ['.spa'],
    VERIFIED: []
  },
  TAR: {
    TYPE: ['.tar'],
    VERIFIED: ['.tar']
  },
  TXT: {
    TYPE: ['.txt'],
    VERIFIED: ['text/plain']
  },
  JPGTIF: {
    TYPE: ['.jpg', '.tif'],
    VERIFIED: ['image/jpeg', 'image/tiff']
  },
};
// form data 请求
const FORMDATA_URL = [
  '/api/oss/upload',
  '/api/syn/touch/summary/download',
  '/api/big/file/storage/upload/chunk',
  '/api/oss/batch/upload',
  '/api/search/request/analysis/spaConversion'
];
// 数据字典 key
const CONFIG_ITEM_KEYS = {
  MD_ITEM_TYPE: 'md_item_type',
  BU: 'bu',
  MODULE_CALL_METHOD: 'module_call_method',
  // MD_TAG_GROUP: 'md_tag_group',
  MD_TAG_TYPE: 'md_tag_type',
  CAMP_ROLE: 'camp_role',
  MODULE: 'module',
  SYS_ROLE: 'sys_role'
};
// module request page
const REQUEST_PAGE = {
  'SynTouch': {
    detailsUrl: '/synTouch/details',
    listUrl: '/synTouch/list',
    detialIdName: 'synTouchProjectId',
    moduleNames: ['SynTouch'],
  },
  'Search': {
    detailsUrl: '/search/details',
    listUrl: '/search/list',
    detialIdName: 'searchRequestId',
    moduleNames: ['IR', 'SEM'],
  },
  'Big Simulation File': {
    detailsUrl: '/bigSimulationFile/details',
    listUrl: '/bigSimulationFile/list',
    detialIdName: 'bigFileProjectId',
    moduleNames: ['Big Simulation File'],
  },
  'Experimental Data': {
    detailsUrl: '/experimentalData/details',
    listUrl: '/experimentalData/list',
    detialIdName: 'experimentalProjectId',
    moduleNames: ['Experimental Data'],
  },
};

const APPROVAL_STATUS = {
  APPROVED: 'Approved',
  REJECTED: 'Rejected',
  PENDING: 'Pending',
  DRAFT: 'Draft',
};
const RES_MODE = {
  NEW: 'new',
  EDIT: 'edit',
  VIEW: 'view',
  APPROVAL: 'approval',
  TESTEREDIT: 'testerEdit',
};
export {
  BABY,
  FEM,
  DEFAULTIMAGEURL,
  DEFAULTATTACHMENTURL,
  ADMIN,
  PRPD,
  TESTER,
  DEFAULTPLOTIMAGEURL,
  REDIRECTURI,
  LOGINPATH,
  REFRESHTOKENRUI,
  OCPAPIMSUBSCRIPTIONKEY,
  PINGVALIDATEURL,
  EAGLEEYEURL,
  ACCEPT_TYPE,
  FORMDATA_URL,
  DATEFORMAT,
  DATEFORMAT_HMS,
  SYSCODE,
  DROPDOWN,
  TEXTINPUT,
  NUMBERINPUT,
  DATEPICKER,
  ATTACHMENT,
  TEXTAREA,
  CONFIG_ITEM_KEYS,
  REQUEST_PAGE,
  APPROVAL_STATUS,
  RES_MODE,
};